package com.demo.proxy.myproxyfulan;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler {

	private Object targetObject;

	public MyInvocationHandler(Object target) {
		this.targetObject = target;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println("方法调用前。。。");

		Object result = method.invoke(this.targetObject, args);
		System.out.println("结果：" + result);

		System.out.println("方法调用结束");

		return result;
	}

}
